import request from '@/utils/request'
// , setToken, removeToken
import { getToken } from '@/utils/auth'

export function addInventorySheet(query) { // 新增盘点单
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/addInventorySheet',
    method: 'get',
    params: query
  })
}

export function getInventorySheet(query) { // 查询盘点单
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/getInventorySheet',
    method: 'get',
    params: query
  })
}

export function getInventorySheetDetails(query) { // 查询盘点单明细
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/getInventorySheetDetails',
    method: 'get',
    params: query
  })
}

export function saveInventorySheetAndDetails(data) { // 保存盘点单
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/saveInventorySheetAndDetails',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

export function filishInventorySheetDetailsById(data) { // 结束盘点单
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/filishInventorySheetDetailsById',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

export function exportInventoryInfo(query) { // 导出盘点单
  return request({
    url: '/wxh-cloud-rest/rest/pas/' + getToken() + '/inventory/exportInventoryInfo',
    method: 'get',
    params: query
  })
}
